<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>

<body>
    <script>
        var arr = ['a', 'b', 'c', 'd', 'e'];
        len = arr.length;
        var resultArr = [];
        for (var j = 1; j <= 16; j++) {
            resultArr = [];
            for (var i = 0; i < len; i++) {
                resultArr[(i + 2) % len] = arr[i];
            }
            arr = resultArr;
            console.log(resultArr + '第' + j + '次');
        }
    </script>
</body>

</html>